<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //1.打印人的一生,从1岁到100岁
        var age = 1;
        do {
            console.log('今年' + age + '岁了');
            age++;
        } while (age <= 100)
        //2.计算1~100之间所有整数的和
        var num = 1;
        var sum = 0;
        do {
            sum += num;
            num++;
        } while (num <= 100)
        console.log('1~100所有整数和为:' + sum);

        //3.弹出一个提示框,你爱我吗?如果输入我爱你,就提示结束,否则,就一直询问

        do {
            var a = prompt('你爱我吗?');
        } while (a !== '我爱你')
        alert('我也爱你');
    </script>
</head>

<body>

</body>

</html>